<!DOCTYPE html>
{% load staticfiles %}
<html lang="en">
    <meta charset="UTF-8">
     <!-- 引入jQuery -->
    <script src="http://apps.bdimg.com/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
    <script src="http://code.jquery.com/jquery-latest.js"></script>
     <!-- 引入 Bootstrap -->
     <link href="{% static 'bootstrap/css/bootstrap.min.css' %}" rel="stylesheet" type="text/css">
     <link href="{% static 'bootstrap/css/bootstrap.css' %}" rel="stylesheet" type="text/css">
     <script type="text/javascript" src="{% static 'bootstrap/js/bootstrap.min.js' %}"></script>
     <script type="text/javascript" src="{% static 'bootstrap/js/bootstrap.js' %}"></script>
    <script type="text/javascript" src="{% static 'learn/dataTable.js' %}"></script>
	<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
     <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
        <![endif]-->
<head>
    <title>linux命令测试</title>
</head>
<body>
<div class="container">
    <select class="form-control" style="margin-top: 0px;width: 700px"  id="xtlx">
        <option>windows</option>
        <option>linux</option>
    </select>
    <label>命令</label>
    <div>
        <input type="text" class="form-control" id="cmd" placeholder="请输入命令" style="width: 700px">
    </div>
    <label>结果</label>
    <div>
        <textarea id="result" style="width: 700px;height: 700px"></textarea>
    </div>
    <div>
        <button onclick="getresult()">提交</button>
    </div>

</div>
<script>
    function  getresult() {
    var cmdtext=$('#cmd').val();
    var xtlx=$('#xtlx').val();
    debugger
          $.ajax({
                type:"POST",
                url:'/my_test/getresult',
                data:{
                    'cmdtext':cmdtext,
                    'xtlx':xtlx,
                    },
                async: false,
                error: function(request) {
                    $("#isok")[0].innerText=request.status;
                    isshuxin=true;
                },
                success: function(result) {
                  $("#result").val(result["result"])
                    $("#cmd").val("")
                }
            });
            return false;
}
</script>

</body>
</html>